package com.vhuomai.wechat.handler;

import com.vhuomai.weixin.common.exception.WxErrorException;
import com.vhuomai.weixin.common.session.WxSessionManager;
import com.vhuomai.weixin.mp.api.WxMpMessageHandler;
import com.vhuomai.weixin.mp.api.WxMpService;
import com.vhuomai.weixin.mp.bean.message.WxMpXmlMessage;
import com.vhuomai.weixin.mp.bean.message.WxMpXmlOutMessage;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;

import java.util.Map;

public class UnsubscribeHandler implements WxMpMessageHandler {
    
    private Logger logger = LoggerFactory.getLogger(this.getClass());
    
    @Override
    public WxMpXmlOutMessage handle(WxMpXmlMessage wxMessage, Map<String, Object> context, WxMpService wxMpService, WxSessionManager sessionManager) throws WxErrorException {
        String openId = wxMessage.getFromUser();
        logger.info("取消关注用户 OPENID: " + openId);
        return null;
    }
}
